/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.vng.zing.survey.controller;

import com.vng.cookies.CookieUtils;
import com.vng.follow.client.FollowClient;
import com.vng.session.client.SessionClient;
import com.vng.session.thrift.Session;
import com.vng.session.thrift.SessionResult;
import com.vng.zing.stdprofile2.client.StdpofileClient;
import com.vng.zing.stdprofile2.thrift.TValue;
import com.vng.zing.stdprofile2.thrift.TValueResult;
import com.vng.zing.zcommon.thrift.OpHandle;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.vng.zing.survey.utility.ZingMeService;

/**
 *
 * @author kienpd
 */
public class TestController extends BaseController{

    @Override
    public String render(HttpServletRequest request, HttpServletResponse resp) throws IOException, Exception {
         String content = "";
          // check login
          String fanname = request.getParameter("f");
          Session session = ZingMeService.getSesstion(request);
          System.out.println("session:"+ session);
          content +="session:"+ session.toString()+"<br>";
          TValue user = ZingMeService.getproflieUser(session.getAccountName());
          content +="user:"+ user.toString()+"<br>";
          TValue fan  = ZingMeService.getproflieUser(fanname);
            content +="fan:"+ fan.toString()+"<br>";
            content += FollowClient.getInstance().isFan(user.getUID(), fan.getUID());
          
//          System.out.println("profile:"+tValueResult.toString());
//          content+="profile:"+tValueResult.toString();
         return content;
       // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
}
